﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Windows.Forms;


namespace SharedGamesClasses {
    public static class Pig {

        public const int NUM_OF_PLAYERS = 2;
        public const int USER = 0;
        public const int COMPUTER = 1;
        public const int END_SQUARE = 30;

        // More constants and/or class variables may be needed.

        
       

        private static string[] playersName = new string[NUM_OF_PLAYERS] { "Player", "Computer" };

        private static int[] pointsTotal = new int[NUM_OF_PLAYERS] { 0, 0 };

        private static Die die = new Die();

        /// <summary>
        /// Reset all class variables to "zeroed" values,
        /// counters and flags but not the die.
        /// 
        /// used by both Console and GUI to ensure subsequent 
        /// playing of the game is correct
        /// </summary>
        public static void ResetGlobals() {

           
        } // end Reset Globals



      
        /// <summary>
        /// Determines if the specified player (who) has won
        /// </summary>
        /// <param name="who"> a player</param>
        /// <returns> true if specified player has won, false otherwise</returns>
        public static bool HasWon(int who) {
            return (pointsTotal[who] >= END_SQUARE);
        } //end HasWon

        /// <summary>
        /// Plays the game of Pig  until the user decides to stop
        /// Used by Console version only
        /// </summary>
        public static void PlayConsole() {  
         

        } //end PlayConsole


        /* The following method should be called by your GUI code.
         * I.e. Do not use it when writing your Console game,
         * but do not delete it. */

        /// <summary>
        /// Plays one roll of the die for a specified player (who).
        /// 
        /// Used by GUI version to roll a die once.
        /// </summary>
        /// <param name="who">a player</param>
        /// <param name="firstRoll"> true indicates it is the first roll of "who's" turn,
        /// false indicates it is a continuation of "who's" turn</param>
        /// <returns>true if player has not thrown a 1, otherwise false</returns>
        public static bool PlayGUI(int who, bool firstRoll) {
            bool result = true;
            
            // code to be inserted here
            
            // the following statement is only provided to ensure code compiles
            // it can be deleted should your logic permits it with appropriate 
            // placed return statements.
            return result;


        }//end PlayGui

    } // end Pig class
}
